<?= modules::run('users/user_include'); ?>
<?php  

    $input = array("week2", "week3","week4","week5","week6","week7","week8");


?>
<div style="height: 50px;"></div>
<div class="content_contest" style="margin:0;">
	<div class="jsc_list_week" style="height: 536px;">
		<div class="width_list_week">
			<div class="contest_new left" style="margin-left:200px; width:2990px;">
				<div class="title_list_week">
					<div class="fs30">Giải thưởng</div>
					<div>8 Giải tuần, 18 Giải phụ và 1 Giải chung cuộc - Tổng giá trị lên đến 160.000.000 VNĐ</div>
				</div>
				<div class="content_contest_new">
                   <?php
            			if($prices){
            				$i=1;
                            $ran = 1;
                            $rand_keys = array_rand($input, 7);
            				foreach($prices as $v){
            		?>
                    
                    <div class="<?php if($i==1){ echo 'week1' ;}else{ echo $input[$rand_keys[$ran]]; }?>">
                        <div class="name_week"><?= $v->name?></div>
                        <div class="price_week"><?= $v->title_price?></div>
                      
                            <?php if($v->active == 0){ ?>
                              <div class="img_price_week">
                                 <div class="a_prices_active"><a href="<?= $v->link?>" target="_blank"><img  src="<?=PATH_URL.'static/uploads/weeks/'.$v->img_price?>" /></a></div>
                                 <div class="bg_prices_active a_prices_active1">
                                     <a href="<?= $v->link?>" target="_blank">
                                        <?= $v->detail_product?>
                                     </a>
                                 </div>
                                 <script type="text/javascript">
                                
                                     $(".img_price_week").hover(
                                          function () {
                                              $(".a_prices_active",this).stop(true,true).css("display","none")
                                              $(".a_prices_active1",this).fadeIn("slow");
                                              
                                
                                              
                                          }, 
                                          function () {
                                                $(".a_prices_active1",this).stop(true,true).css("display","none")
                                                $(".a_prices_active", this).fadeIn("slow");
                                          }
                                    );
                                 </script>
                              </div> 
                            <?php }else { ?> 
                                <script type="text/javascript">
                                
                                $('.cycle_weeks').cycle({ 
                            			fx:    'fade', 
                       			        sync:   0, 
                          			    delay: -2000 ,
                                        speedIn:  2500, 
                                        speedOut: 1000
                            		});
                                </script>
                               <div class="img_price_week cycle_weeks ">
                                 <div><a href="<?= $v->link?>" target="_blank"><img  src="<?=PATH_URL.'static/uploads/weeks/'.$v->img_price?>" /></a></div>
                                 <div class="bg_prices_active">
                                 <a href="<?= $v->link?>" target="_blank">
                                    <?= $v->detail_product?>
                                 </a>
                                 </div>
                               </div> 
                                    
                            <?php } ?>
                           
                       
               
                    </div>
                    <?php 
                    $i++;
                    $ran++;
							if($ran >= 7)
							{
							   $rand_keys = array_rand($input, 7);
								$ran = 1;
							}
                    }}?>
				    <?php
            			if($chungcuoc){
            				foreach($chungcuoc as $v){
            		?>
                        <div class="chungcuoc">
                            <div class="name_week"><?= $v->name?></div>
                            <div class="price_week"><?= $v->title_price?></div>
                            <img class="img_price_chung_cuoc" src="<?=PATH_URL.'static/images/tim/timthumb.php?src='.PATH_URL.'static/uploads/weeks/'.$v->img_price.'&amp;w=417&amp;h=285;zc=0&amp;q=100'?>" />
                        </div>
                    
                    <?php
                    }}
                    ?>
                    
					<div class="clearAll"></div>
				</div>
			</div>
			<div class="contest_new contest_thele left">
				<div class="title_list_week">
					<div class="fs30">Thể lệ</div>
                    <div>Chia sẽ khoảnh khắc bất ngờ </div>
				</div>
				<div class="content_contest_new">
					<div class="contest_new_left">
						<div class="small_contest">
							<a href="#" class="ajax_url" rel="<?= PATH_URL . 'home/rules' ?>"><img src="<?=PATH_URL.'static/images/img_thele.jpg'?>" alt="" /></a>
							<a href="#"class="ajax_url" rel="<?= PATH_URL . 'home/rules' ?>"><div class="text bg_4">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><p>Thể lệ</p></td>
									</tr>
								</table>
							</div></a>
						</div>
						<div class="small_contest">
							<a href="#" class="ajax_url" rel="<?= PATH_URL . 'home/tinhdiem' ?>"><img src="<?=PATH_URL.'static/images/img_caculator.jpg'?>" alt="" /></a>
							<a href="#" class="ajax_url" rel="<?= PATH_URL . 'home/tinhdiem' ?>"><div class="text bg_5">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><p>Cách tính điểm</p></td>
									</tr>
								</table>
							</div></a>
						</div>
						<div class="small_contest">
							<a href="#" class="ajax_url" rel="<?= PATH_URL . 'home/winner' ?>"><img src="<?=PATH_URL.'static/images/img_list_trungthuong.jpg'?>" alt="" /></a>
							<a href="#" class="ajax_url" rel="<?= PATH_URL . 'home/winner' ?>"><div class="text bg_6">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><p>Danh sách thắng giải</p></td>
									</tr>
								</table>
							</div></a>
						</div>
					</div>
					<div class="clearAll"></div>
				</div>
			</div>
		
			
			<div class="clearAll"></div>
		</div>
	</div>
</div>
<div class="footer_content">
    <div class="btn_pre">
        <a href="#" class="ajax_url" rel="<?= PATH_URL . 'contest/list_week' ?>"><img src="<?= PATH_URL . 'static/images/btn/' ?>btn_trove.png" /></a>
        <span class="trove">Trở về trang chính</span>
        
    </div>
   
    <div class="clearAll"></div>
</div>
<div class="clearAll"></div>
<script type="text/javascript">
	$(document).ready(function(){
		var width = 0;
		$('.width_list_week .contest_new').each(function(){
			width = width + $(this).width();
		});
		// alert(width);
		var count = $('.width_list_week .contest_new').length;
		var margin = 75*count;
		var width_item = width + margin + 200;
		$('.width_list_week').width(width_item+'px');
		var element = $('.jsc_list_week').jScrollPane({
            showArrows: true,
            horizontalGutter: 0,
            verticalGutter: 20
        });
		var api = element.data('jsp');
		element.bind('mousewheel',function (event, delta, deltaX, deltaY){
			api.scrollByX(-(delta * 30));
			return false;
		});

	});
</script>